package com.compiler.lexico.action;

import java.io.IOException;
import java.io.RandomAccessFile;

import com.compiler.lexico.token.SymbolTable;
import com.compiler.lexico.token.Token;
import com.compiler.logger.Logger;

public class Error extends AbstractAction {
	private String error;

	public Error(Token token, String error, SymbolTable symbolTable) {
		super(token,symbolTable);
		this.error = error;
	}
	
	@Override
	public void exec(RandomAccessFile raf) throws IOException {
		this.token.clean();
		Logger.getInstance().log("LEXICO", Logger.ERRORLevel, "Linea "+this.token.getLine()+" : "+this.error,"LEXICO");
	}

	@Override
	public String toString() {
		return this.error;
	}

}
